package com.ld.hpfs.dao;

import java.util.ArrayList;
import java.util.HashMap;

import org.springframework.stereotype.Repository;

@Repository
public interface RuleMapper {

	/*
	 * 增加规则
	 */
	public int RuleSet(HashMap<String, Object> param);

	/*
	 * 规则一览页面的查询功能
	 */
	public ArrayList<HashMap<String, Object>> getRuleList(
			HashMap<String, Object> param);

	/*
	 * 获取页面数据条数
	 */
	public int getRuleListCount(HashMap<String, Object> param);

	/*
	 * 规则一览的删除
	 */
	public int deleteRuleList(HashMap<String, Object> param);

	/*
	 * 查询已选择的规则
	 */
	public ArrayList<HashMap<String, Object>> getCheckedRule(
			HashMap<String, Object> param);

	/*
	 * 获取客户信息
	 */
	public ArrayList<HashMap<String, Object>> getCustInfo(
			HashMap<String, Object> param);
	/*
	 * 获取创建者信息
	 */
	public ArrayList<HashMap<String, Object>> getCreator(
			HashMap<String, Object> param);
	/*
	 * 共同条件
	 */
	public ArrayList<HashMap<String, Object>> getCommonConditions(
			HashMap<String, Object> param);

	/*
	 * 获取对应Rule_id 的各条件项
	 */
	public ArrayList<HashMap<String, Object>> getRuleConditions(
			HashMap<String, Object> param);

	/*
	 * 获取自定义摘要信息
	 */
	public ArrayList<HashMap<String, Object>> getAbstractInfo(
			HashMap<String, Object> param);

	/*
	 * 以下是判断规则是否存在
	 */
	public ArrayList<HashMap<String, Object>> checkRuleIsRepeat1(
			HashMap<String, Object> param);

	public ArrayList<HashMap<String, Object>> checkRuleIsRepeat2(
			HashMap<String, Object> param);

	/*
	 * 接收第三个框的值
	 */
	public ArrayList<HashMap<String, Object>> getAdjustAfterRule(
			HashMap<String, Object> param);

	/*
	 * 发票分组删除按钮
	 */
	public void MergeRuleDelete(HashMap<String, Object> param);

	/*
	 * 清空原有SORT
	 */
	public void clearSort(HashMap<String, Object> param);

	/*
	 * 更改SORT
	 */
	public int updateSort(HashMap<String, Object> param);

	/*
	 * 获取替换规则
	 */
	public ArrayList<HashMap<String, Object>> getReplaceRule(
			HashMap<String, Object> param);

	public ArrayList<HashMap<String, Object>> getReplaceUnit(
			HashMap<String, Object> param);

	/*
	 * 返利查询
	 */
	public HashMap<String, Object> getRebate(HashMap<String, Object> param);

	/*
	 * 获取拆分方式的值
	 */
	public HashMap<String, Object> getSplitWay(HashMap<String, Object> param);

	/*
	 * 获得折扣信息
	 */
	public HashMap<String, Object> getDiscoun(HashMap<String, Object> param);

	// 以下是增加履历前对原始表做查询的方法
	public ArrayList<HashMap<String, Object>> getRuleMain(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleCondition(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleAbstractRemark(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleReplaceOthers(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleReplaceUnit(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleAdjustAfter(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleDiscount(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleRebate(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleSplit(int ruleId);
	
	public ArrayList<HashMap<String, Object>> getRuleDocKeep(int ruleId);

	public ArrayList<HashMap<String, Object>> getRuleCompany();

	/*
	 * 以下是循环增加履历中action，user_id，update_time字段的方法
	 */
	public void addRuleMainHistory(HashMap<String, Object> history);

	public void addRuleConditionHistory(HashMap<String, Object> history1);

	public void addRuleAbsRemHistory(HashMap<String, Object> history2);

	public void addRuleRplOthHistory(HashMap<String, Object> history3);

	public void addRuleRplUnitHistory(HashMap<String, Object> history4);

	public void addRuleAfterHistory(HashMap<String, Object> history5);

	public void addRuleDiscountHistory(HashMap<String, Object> history6);

	public void addRuleRebateHistory(HashMap<String, Object> history7);

	public void addRuleSplitHistory(HashMap<String, Object> history8);

	public void addRuleCompanyHistory(HashMap<String, Object> history9);
	
	public void addRuleDocKeepHistory(HashMap<String, Object> history10);

	/*
	 *  规则主表导入
	 */
	public HashMap<String, Object> importRuleMain(HashMap<String, Object> param);

	/*
	 *  规则条件表条件信息导入
	 */
	public int importRuleCondition(HashMap<String, Object> param2);

	/*
	 *  自定义摘要备注表信息导入
	 */
	public int importAbstractRemark(HashMap<String, Object> param3);
	
	/*
	 *  单据状态信息导入
	 */
	public int importRuleDocStatus(HashMap<String, Object> param3);
	
	/*
	 *  替换商品名、替换客户名、替换规格信息导入
	 */
	public int importReplaceGoodsCustType(HashMap<String, Object> param3);

	/*
	 *  替换单位信息导入
	 */
	public int importReplaceUnit(HashMap<String, Object> param3);

	/*
	 *  特殊规则信息导入
	 */
	public int importSpecialRule(HashMap<String, Object> param3);

	/*
	 *  折扣信息导入
	 */
	public int importRuleDiscount(HashMap<String, Object> param3);

	/*
	 *  返利信息导入
	 */
	public int importRuleRebate(HashMap<String, Object> param3);

	/*
	 *  拆分信息导入
	 */
	public int importRuleSplit(HashMap<String, Object> param3);

	/*
	 *  Check客户是否存在
	 */
	public HashMap<String, Object> getCustomerName(
			HashMap<String, Object> checkParam);

	/*
	 *  check客户代码是否存在
	 */
	public int checkCustCode(HashMap<String, Object> param);

	/*
	 *  导出ruleMain
	 */
	public ArrayList<HashMap<String, Object>> getRuleMainData(
			HashMap<String, Object> param);

	/*
	 *  导出ruleConditionData
	 */
	public ArrayList<HashMap<String, Object>> getRuleConditionData(
			HashMap<String, Object> param);

	/*
	 *  导出adjustAfterRule
	 */
	public ArrayList<HashMap<String, Object>> getAdjustAfterRuleData(
			HashMap<String, Object> param);

	/*
	 *  导出discount规则
	 */
	public ArrayList<HashMap<String, Object>> getRuleDiscountData(
			HashMap<String, Object> param);

	/*
	 *  导出rebate规则
	 */
	public ArrayList<HashMap<String, Object>> getRuleRebateData(
			HashMap<String, Object> param);

	/*
	 *  导出split规则
	 */
	public ArrayList<HashMap<String, Object>> getRuleSplitData(
			HashMap<String, Object> param);

	/*
	 *  导出替换商品、客户、规格规则
	 */
	public ArrayList<HashMap<String, Object>> getreplaceOthersData(
			HashMap<String, Object> param);

	/*
	 *  导出替换单位规则
	 */
	public ArrayList<HashMap<String, Object>> getreplaceUnitData(
			HashMap<String, Object> param);

	/*
	 *  导出自定义摘要、备注规则
	 */
	public ArrayList<HashMap<String, Object>> getCustomizeRemarkData(
			HashMap<String, Object> param);
	
	/*
	 *  导出单据状态
	 */
	public ArrayList<HashMap<String, Object>> getDocTypeData(
			HashMap<String, Object> param);

	public ArrayList<HashMap<String, Object>> getRuleSort(
			HashMap<String, Object> param);

	/*
	 * 获得规则导出的规则ID
	 */
	public ArrayList<HashMap<String, Object>> getExportId(
			HashMap<String, Object> listParam);

	/*
	 * 修改页面---获取单据状态的值
	 */
	public HashMap<String, Object> getDocType(HashMap<String, Object> param);
	
	/*
	 * 公司代码的获取
	 */
	public HashMap<String, Object> getCompanyCode(HashMap<String, Object> param);

	public int insertRules(HashMap<String, Object> param);

	public int updateRules(HashMap<String, Object> param);

	public int getLockStatus(HashMap<String, Object> param);

	public int getMaxDetailId(String ruleType);
	
	public int getMaxRuleId(HashMap<String, Object> param);
	
}
